package interceptor;

import java.util.Map;

import com.opensymphony.xwork2.Action;
import com.opensymphony.xwork2.ActionInvocation;
import com.opensymphony.xwork2.interceptor.AbstractInterceptor;

import entity.Users;

public class AuthInterceptor extends AbstractInterceptor {

	@Override
	public String intercept(ActionInvocation invoc) throws Exception {
		Map session = invoc.getInvocationContext().getSession();
		Users user = (Users)session.get("user");
		if(user==null){
			
			return Action.LOGIN;
		}
		return invoc.invoke();
	}

}
